#' Online ulcer
#'
#' @param period rolling window period
#'
#' @return an ulcer_c object
#' @export
#'
new_ulcer <- function(period)
{
  mk_online_func_x("ulcer", period)
}

#' Online BBand
#'
#' @param period rolling window period
#' @param z zscore threshold
#' @param r attenuation, used with "z" variant
#' @param type type of bband
#'
#' @return a stateful function
#' @export
#'
new_bband <- function(period, z, r, type = c("bband", "zbband", "ebband", "ezband"))
{
  type <- match.arg(type)
  switch(type,
         bband = mk_online_func_x("bband", period, z),
         zbband = mk_online_func_x("zbband", period, z, r),
         ebband = mk_online_func_x("ebband", period, z),
         ezband = mk_online_func_x("ezband", period, z, r))
}
